// Copyright (c) 2024 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=517a730fa2379060935e9921061a0c8b6149cfab$
//

#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
#pragma once

#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_devtools_message_observer_capi.h"
#include "include/capi/cef_download_item_capi.h"
#include "include/capi/cef_drag_data_capi.h"
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_image_capi.h"
#include "include/capi/cef_navigation_entry_capi.h"
#include "include/capi/cef_permission_request_capi.h"
#include "include/capi/cef_registration_capi.h"
#include "include/capi/cef_request_context_capi.h"
#include "include/capi/cef_task_capi.h"
#include "include/internal/cef_string_map.h"

#ifdef __cplusplus
extern "C" {
#endif

struct _cef_browser_host_t;
struct _cef_client_t;

///
/// Structure to implement to be notified of asynchronous completion via
/// cef_browser_host_tBase::execute_java_script().
///
typedef struct _cef_java_script_result_callback_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Method that will be called upon completion. |num_deleted| will be the
  /// number of cookies that were deleted.
  ///
  void(CEF_CALLBACK* on_java_script_exe_result)(
      struct _cef_java_script_result_callback_t* self,
      struct _cef_value_t* result);
} cef_java_script_result_callback_t;

///
/// Structure to implement to be notified of asynchronous completion via
/// cef_browser_host_tBase::store_web_archive().
///
typedef struct _cef_store_web_archive_result_callback_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Method that will be called upon completion. |result| will either be the
  /// filename under which the file was saved, or NULL if saving the file
  /// failed.
  ///
  void(CEF_CALLBACK* on_store_web_archive_done)(
      struct _cef_store_web_archive_result_callback_t* self,
      const cef_string_t* result);
} cef_store_web_archive_result_callback_t;

///
/// Structure to implement to be notified of asynchronous completion via
/// cef_browser_host_tBase::set_gesture_event_result().
///
typedef struct _cef_gesture_event_callback_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Method that will be called upon completion.
  ///
  void(CEF_CALLBACK* continue_task)(struct _cef_gesture_event_callback_t* self,
                                    int result,
                                    int stopPropagation);
} cef_gesture_event_callback_t;

///
/// Structure to implement to be notified of asynchronous web message channel.
///
typedef struct _cef_web_message_receiver_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Method that will be called upon |PostPortMessage|. |message| will be sent
  /// to another end of web message channel.
  ///
  void(CEF_CALLBACK* on_message)(struct _cef_web_message_receiver_t* self,
                                 struct _cef_value_t* message);

  ///
  /// The same as OnMessage, the result of the execution will be returned.
  ///
  int(CEF_CALLBACK* on_message_with_bool_result)(
      struct _cef_web_message_receiver_t* self,
      struct _cef_value_t* message);
} cef_web_message_receiver_t;

///
/// Structure to implement to be notified of compiling javascript completion via
/// cef_browser_host_tBase::precompile_java_script().
///
typedef struct _cef_precompile_callback_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Method that will be called upon completion.
  ///
  void(CEF_CALLBACK* on_precompile_finished)(
      struct _cef_precompile_callback_t* self,
      int32_t result);
} cef_precompile_callback_t;

///
/// options and info of cef_browser_host_tBase::precompile_java_script().
///
typedef struct _cef_cache_options_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Return the response headers of javascript request.
  ///
  cef_string_map_t(CEF_CALLBACK* get_response_headers)(
      struct _cef_cache_options_t* self);
} cef_cache_options_t;

///
/// cef_set_lock_callback_t
///
typedef struct _cef_set_lock_callback_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Handle.
  ///
  void(CEF_CALLBACK* handle)(struct _cef_set_lock_callback_t* self, int key);
} cef_set_lock_callback_t;

///
/// Structure used to represent a browser. When used in the browser process the
/// functions of this structure may be called on any thread unless otherwise
/// indicated in the comments. When used in the render process the functions of
/// this structure may only be called on the main thread.
///
typedef struct _cef_browser_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// True if this object is currently valid. This will return false (0) after
  /// cef_life_span_handler_t::OnBeforeClose is called.
  ///
  int(CEF_CALLBACK* is_valid)(struct _cef_browser_t* self);

  ///
  /// Returns the browser host object. This function can only be called in the
  /// browser process.
  ///
  struct _cef_browser_host_t*(CEF_CALLBACK* get_host)(
      struct _cef_browser_t* self);

  ///
  /// Returns true (1) if the browser can navigate backwards.
  ///
  int(CEF_CALLBACK* can_go_back)(struct _cef_browser_t* self);

  ///
  /// Navigate backwards.
  ///
  void(CEF_CALLBACK* go_back)(struct _cef_browser_t* self);

  ///
  /// Returns true (1) if the browser can navigate forwards.
  ///
  int(CEF_CALLBACK* can_go_forward)(struct _cef_browser_t* self);

  ///
  /// Navigate forwards.
  ///
  void(CEF_CALLBACK* go_forward)(struct _cef_browser_t* self);

  ///
  /// Returns true (1) if the browser is currently loading.
  ///
  int(CEF_CALLBACK* is_loading)(struct _cef_browser_t* self);

  ///
  /// Reload the current page.
  ///
  void(CEF_CALLBACK* reload)(struct _cef_browser_t* self);

  ///
  /// Reload the current page ignoring any cached data.
  ///
  void(CEF_CALLBACK* reload_ignore_cache)(struct _cef_browser_t* self);

  ///
  /// Stop loading the page.
  ///
  void(CEF_CALLBACK* stop_load)(struct _cef_browser_t* self);

  ///
  /// Returns the globally unique identifier for this browser. This value is
  /// also used as the tabId for extension APIs.
  ///
  int(CEF_CALLBACK* get_identifier)(struct _cef_browser_t* self);

  ///
  /// Returns true (1) if this object is pointing to the same handle as |that|
  /// object.
  ///
  int(CEF_CALLBACK* is_same)(struct _cef_browser_t* self,
                             struct _cef_browser_t* that);

  ///
  /// Returns true (1) if the browser is a popup.
  ///
  int(CEF_CALLBACK* is_popup)(struct _cef_browser_t* self);

  ///
  /// Returns true (1) if a document has been loaded in the browser.
  ///
  int(CEF_CALLBACK* has_document)(struct _cef_browser_t* self);

  ///
  /// Returns the main (top-level) frame for the browser. In the browser process
  /// this will return a valid object until after
  /// cef_life_span_handler_t::OnBeforeClose is called. In the renderer process
  /// this will return NULL if the main frame is hosted in a different renderer
  /// process (e.g. for cross-origin sub-frames). The main frame object will
  /// change during cross-origin navigation or re-navigation after renderer
  /// process termination (due to crashes, etc).
  ///
  struct _cef_frame_t*(CEF_CALLBACK* get_main_frame)(
      struct _cef_browser_t* self);

  ///
  /// Returns the focused frame for the browser.
  ///
  struct _cef_frame_t*(CEF_CALLBACK* get_focused_frame)(
      struct _cef_browser_t* self);

  ///
  /// Returns the frame with the specified identifier, or NULL if not found.
  ///
  struct _cef_frame_t*(CEF_CALLBACK* get_frame_byident)(
      struct _cef_browser_t* self,
      int64 identifier);

  ///
  /// Returns the frame with the specified name, or NULL if not found.
  ///
  struct _cef_frame_t*(CEF_CALLBACK* get_frame)(struct _cef_browser_t* self,
                                                const cef_string_t* name);

  ///
  /// Returns the number of frames that currently exist.
  ///
  size_t(CEF_CALLBACK* get_frame_count)(struct _cef_browser_t* self);

  ///
  /// Returns the identifiers of all existing frames.
  ///
  void(CEF_CALLBACK* get_frame_identifiers)(struct _cef_browser_t* self,
                                            size_t* identifiersCount,
                                            int64* identifiers);

  ///
  /// Returns the names of all existing frames.
  ///
  void(CEF_CALLBACK* get_frame_names)(struct _cef_browser_t* self,
                                      cef_string_list_t names);

  ///
  /// Returns the Permission Request Delegate object.
  ///
  struct _cef_browser_permission_request_delegate_t*(
      CEF_CALLBACK* get_permission_request_delegate)(
      struct _cef_browser_t* self);

  ///
  /// Returns the Geolocation Permission handler object.
  ///
  struct _cef_geolocation_acess_t*(CEF_CALLBACK* get_geolocation_permissions)(
      struct _cef_browser_t* self);

  ///
  /// Returns true (1) if the browser can navigate forwards.
  ///
  int(CEF_CALLBACK* can_go_back_or_forward)(struct _cef_browser_t* self,
                                            int num_steps);

  ///
  /// Navigate backwards or forwards.
  ///
  void(CEF_CALLBACK* go_back_or_forward)(struct _cef_browser_t* self,
                                         int num_steps);

  ///
  /// DeleteHistory
  ///
  void(CEF_CALLBACK* delete_history)(struct _cef_browser_t* self);

  ///
  /// display the selection control when click Free copy structure
  ///
  void(CEF_CALLBACK* select_and_copy)(struct _cef_browser_t* self);

  ///
  /// should show free copy menu
  ///
  int(CEF_CALLBACK* should_show_free_copy)(struct _cef_browser_t* self);

  ///
  /// select password dialog to fill
  ///
  void(CEF_CALLBACK* password_suggestion_selected)(struct _cef_browser_t* self,
                                                   int list_index);

  ///
  /// Update browser controls state.
  ///
  void(CEF_CALLBACK* update_browser_controls_state)(struct _cef_browser_t* self,
                                                    int constraints,
                                                    int current,
                                                    int animate);

  ///
  /// Update browser controls height.
  ///
  void(CEF_CALLBACK* update_browser_controls_height)(
      struct _cef_browser_t* self,
      int height,
      int animate);

  ///
  /// Prefetch the resources required by the page, but will not execute js or
  /// render the page.
  ///
  void(CEF_CALLBACK* prefetch_page)(struct _cef_browser_t* self,
                                    cef_string_t* url,
                                    cef_string_t* additionalHttpHeaders);

  ///
  /// Reload the current page with original url.
  ///
  void(CEF_CALLBACK* reload_original_url)(struct _cef_browser_t* self);

  ///
  /// Can save current page as a archive.
  ///
  int(CEF_CALLBACK* can_store_web_archive)(struct _cef_browser_t* self);

  ///
  /// Set user agent for current page.
  ///
  void(CEF_CALLBACK* set_browser_user_agent_string)(
      struct _cef_browser_t* self,
      const cef_string_t* user_agent);

  ///
  /// Is loading to different document.
  ///
  int(CEF_CALLBACK* should_show_loading_ui)(struct _cef_browser_t* self);

  ///
  /// Set force enable zoom.
  ///
  void(CEF_CALLBACK* set_force_enable_zoom)(struct _cef_browser_t* self,
                                            int forceEnableZoom);

  ///
  /// Whether force enable zoom had been enabled.
  ///
  int(CEF_CALLBACK* get_force_enable_zoom)(struct _cef_browser_t* self);

  ///
  /// Returns the NWeb Id.
  ///
  int(CEF_CALLBACK* get_nweb_id)(struct _cef_browser_t* self);

  ///
  /// Set whether the target_blank pop-up window is opened in the current tab.
  ///
  void(CEF_CALLBACK* set_enable_blank_target_popup_intercept)(
      struct _cef_browser_t* self,
      int enableBlankTargetPopup);

  ///
  /// Whether automatically saving password had been enabled.
  ///
  int(CEF_CALLBACK* get_save_password_automatically)(
      struct _cef_browser_t* self);

  ///
  /// Set enable to allow automatically save password
  ///
  void(CEF_CALLBACK* set_save_password_automatically)(
      struct _cef_browser_t* self,
      int enable);

  ///
  /// save or upddate current page password
  ///
  void(CEF_CALLBACK* save_or_update_password)(struct _cef_browser_t* self,
                                              int is_update);

  ///
  /// Whether saving password had been enabled.
  ///
  int(CEF_CALLBACK* get_save_password)(struct _cef_browser_t* self);

  ///
  /// Set enable to save password
  ///
  void(CEF_CALLBACK* set_save_password)(struct _cef_browser_t* self,
                                        int enable);

  ///
  /// Get security level for current page.
  ///
  int(CEF_CALLBACK* get_security_level)(struct _cef_browser_t* self);

  ///
  /// Enable the ability to check website security risks.
  ///
  void(CEF_CALLBACK* enable_safe_browsing)(struct _cef_browser_t* self,
                                           int enable);

  ///
  /// Get whether checking website security risks is enabled.
  ///
  int(CEF_CALLBACK* is_safe_browsing_enabled)(struct _cef_browser_t* self);

  ///
  /// Enable the ability to intelligent tracking prevention, default disabled.
  ///
  void(CEF_CALLBACK* enable_intelligent_tracking_prevention)(
      struct _cef_browser_t* self,
      int enable);

  ///
  /// Get whether intelligent tracking prevention is enabled.
  ///
  int(CEF_CALLBACK* is_intelligent_tracking_prevention_enabled)(
      struct _cef_browser_t* self);

  ///
  /// Get whether Ads block is enabled.
  ///
  int(CEF_CALLBACK* is_ads_block_enabled)(struct _cef_browser_t* self);

  ///
  /// Get whether Ads block is enabled for current page.
  ///
  int(CEF_CALLBACK* is_ads_block_enabled_for_cur_page)(
      struct _cef_browser_t* self);

  ///
  /// Set enable to allow automatically save password
  ///
  void(CEF_CALLBACK* enable_ads_block)(struct _cef_browser_t* self, int enable);

  ///
  /// Set url trust list.
  ///
  int(CEF_CALLBACK* set_url_trust_list_with_err_msg)(
      struct _cef_browser_t* self,
      const cef_string_t* urlTrustList,
      cef_string_t* detailErrMsg);

  ///
  /// Set url trust list.
  ///
  void(CEF_CALLBACK* set_back_forward_cache_options)(
      struct _cef_browser_t* self,
      int32_t size,
      int32_t timeToLive);

  ///
  /// Set adblock switch
  ///
  void(CEF_CALLBACK* set_ad_block_enabled_for_site)(
      struct _cef_browser_t* self,
      int is_adblock_enabled,
      int main_frame_tree_node_id);
} cef_browser_t;

///
/// Callback structure for cef_browser_host_t::RunFileDialog. The functions of
/// this structure will be called on the browser process UI thread.
///
typedef struct _cef_run_file_dialog_callback_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Called asynchronously after the file dialog is dismissed. |file_paths|
  /// will be a single value or a list of values depending on the dialog mode.
  /// If the selection was cancelled |file_paths| will be NULL.
  ///
  void(CEF_CALLBACK* on_file_dialog_dismissed)(
      struct _cef_run_file_dialog_callback_t* self,
      cef_string_list_t file_paths);
} cef_run_file_dialog_callback_t;

///
/// Callback structure for cef_browser_host_t::GetNavigationEntries. The
/// functions of this structure will be called on the browser process UI thread.
///
typedef struct _cef_navigation_entry_visitor_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Method that will be executed. Do not keep a reference to |entry| outside
  /// of this callback. Return true (1) to continue visiting entries or false
  /// (0) to stop. |current| is true (1) if this entry is the currently loaded
  /// navigation entry. |index| is the 0-based index of this entry and |total|
  /// is the total number of entries.
  ///
  int(CEF_CALLBACK* visit)(struct _cef_navigation_entry_visitor_t* self,
                           struct _cef_navigation_entry_t* entry,
                           int current,
                           int index,
                           int total);
} cef_navigation_entry_visitor_t;

///
/// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
/// structure will be called on the browser process UI thread.
///
typedef struct _cef_pdf_print_callback_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Method that will be executed when the PDF printing has completed. |path|
  /// is the output path. |ok| will be true (1) if the printing completed
  /// successfully or false (0) otherwise.
  ///
  void(CEF_CALLBACK* on_pdf_print_finished)(
      struct _cef_pdf_print_callback_t* self,
      const cef_string_t* path,
      int ok);
} cef_pdf_print_callback_t;

///
/// Callback structure for cef_browser_host_t::DownloadImage. The functions of
/// this structure will be called on the browser process UI thread.
///
typedef struct _cef_download_image_callback_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Method that will be executed when the image download has completed.
  /// |image_url| is the URL that was downloaded and |http_status_code| is the
  /// resulting HTTP status code. |image| is the resulting image, possibly at
  /// multiple scale factors, or NULL if the download failed.
  ///
  void(CEF_CALLBACK* on_download_image_finished)(
      struct _cef_download_image_callback_t* self,
      const cef_string_t* image_url,
      int http_status_code,
      struct _cef_image_t* image);
} cef_download_image_callback_t;

///
/// Callback structure for cef_browser_host_t::CreateToPDF. The functions of
/// this structure will be called on the browser process UI thread.
///
typedef struct _cef_pdf_value_callback_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Method that will be executed when the PDF create has completed. |value| is
  /// the output pdf data stream. successfully or false (0) otherwise.
  ///
  void(CEF_CALLBACK* on_receive_value)(struct _cef_pdf_value_callback_t* self,
                                       const char* value,
                                       const long size);
} cef_pdf_value_callback_t;

///
/// Structure used to represent the browser process aspects of a browser. The
/// functions of this structure can only be called in the browser process. They
/// may be called on any thread in that process unless otherwise indicated in
/// the comments.
///
typedef struct _cef_browser_host_t {
  ///
  /// Base structure.
  ///
  cef_base_ref_counted_t base;

  ///
  /// Returns the hosted browser object.
  ///
  struct _cef_browser_t*(CEF_CALLBACK* get_browser)(
      struct _cef_browser_host_t* self);

  ///
  /// Request that the browser close. The JavaScript 'onbeforeunload' event will
  /// be fired. If |force_close| is false (0) the event handler, if any, will be
  /// allowed to prompt the user and the user can optionally cancel the close.
  /// If |force_close| is true (1) the prompt will not be displayed and the
  /// close will proceed. Results in a call to
  /// cef_life_span_handler_t::do_close() if the event handler allows the close
  /// or if |force_close| is true (1). See cef_life_span_handler_t::do_close()
  /// documentation for additional usage information.
  ///
  void(CEF_CALLBACK* close_browser)(struct _cef_browser_host_t* self,
                                    int force_close);

  ///
  /// Helper for closing a browser. Call this function from the top-level window
  /// close handler (if any). Internally this calls CloseBrowser(false (0)) if
  /// the close has not yet been initiated. This function returns false (0)
  /// while the close is pending and true (1) after the close has completed. See
  /// close_browser() and cef_life_span_handler_t::do_close() documentation for
  /// additional usage information. This function must be called on the browser
  /// process UI thread.
  ///
  int(CEF_CALLBACK* try_close_browser)(struct _cef_browser_host_t* self);

  ///
  /// Set whether the browser is focused.
  ///
  void(CEF_CALLBACK* set_focus)(struct _cef_browser_host_t* self, int focus);

  ///
  /// Retrieve the window handle (if any) for this browser. If this browser is
  /// wrapped in a cef_browser_view_t this function should be called on the
  /// browser process UI thread and it will return the handle for the top-level
  /// native window.
  ///
  cef_window_handle_t(CEF_CALLBACK* get_window_handle)(
      struct _cef_browser_host_t* self);

  ///
  /// Retrieve the window handle (if any) of the browser that opened this
  /// browser. Will return NULL for non-popup browsers or if this browser is
  /// wrapped in a cef_browser_view_t. This function can be used in combination
  /// with custom handling of modal windows.
  ///
  cef_window_handle_t(CEF_CALLBACK* get_opener_window_handle)(
      struct _cef_browser_host_t* self);

  ///
  /// Returns true (1) if this browser is wrapped in a cef_browser_view_t.
  ///
  int(CEF_CALLBACK* has_view)(struct _cef_browser_host_t* self);

  ///
  /// Returns the client for this browser.
  ///
  struct _cef_client_t*(CEF_CALLBACK* get_client)(
      struct _cef_browser_host_t* self);

  ///
  /// Returns the request context for this browser.
  ///
  struct _cef_request_context_t*(CEF_CALLBACK* get_request_context)(
      struct _cef_browser_host_t* self);

  ///
  /// Get the current zoom level. The default zoom level is 0.0. This function
  /// can only be called on the UI thread.
  ///
  double(CEF_CALLBACK* get_zoom_level)(struct _cef_browser_host_t* self);

  ///
  /// Change the zoom level to the specified value. Specify 0.0 to reset the
  /// zoom level. If called on the UI thread the change will be applied
  /// immediately. Otherwise, the change will be applied asynchronously on the
  /// UI thread.
  ///
  void(CEF_CALLBACK* set_zoom_level)(struct _cef_browser_host_t* self,
                                     double zoomLevel);

  ///
  /// Call to run a file chooser dialog. Only a single file chooser dialog may
  /// be pending at any given time. |mode| represents the type of dialog to
  /// display. |title| to the title to be used for the dialog and may be NULL to
  /// show the default title ("Open" or "Save" depending on the mode).
  /// |default_file_path| is the path with optional directory and/or file name
  /// component that will be initially selected in the dialog. |accept_filters|
  /// are used to restrict the selectable file types and may any combination of
  /// (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b)
  /// individual file extensions (e.g. ".txt" or ".png"), or (c) combined
  /// description and file extension delimited using "|" and ";" (e.g. "Image
  /// Types|.png;.gif;.jpg"). |callback| will be executed after the dialog is
  /// dismissed or immediately if another dialog is already pending. The dialog
  /// will be initiated asynchronously on the UI thread.
  ///
  void(CEF_CALLBACK* run_file_dialog)(
      struct _cef_browser_host_t* self,
      cef_file_dialog_mode_t mode,
      const cef_string_t* title,
      const cef_string_t* default_file_path,
      cef_string_list_t accept_filters,
      struct _cef_run_file_dialog_callback_t* callback);

  ///
  /// Download the file at |url| using cef_download_handler_t.
  ///
  void(CEF_CALLBACK* start_download)(struct _cef_browser_host_t* self,
                                     const cef_string_t* url);

  ///
  /// Download |image_url| and execute |callback| on completion with the images
  /// received from the renderer. If |is_favicon| is true (1) then cookies are
  /// not sent and not accepted during download. Images with density independent
  /// pixel (DIP) sizes larger than |max_image_size| are filtered out from the
  /// image results. Versions of the image at different scale factors may be
  /// downloaded up to the maximum scale factor supported by the system. If
  /// there are no image results <= |max_image_size| then the smallest image is
  /// resized to |max_image_size| and is the only result. A |max_image_size| of
  /// 0 means unlimited. If |bypass_cache| is true (1) then |image_url| is
  /// requested from the server even if it is present in the browser cache.
  ///
  void(CEF_CALLBACK* download_image)(
      struct _cef_browser_host_t* self,
      const cef_string_t* image_url,
      int is_favicon,
      uint32 max_image_size,
      int bypass_cache,
      struct _cef_download_image_callback_t* callback);

  ///
  /// Print the current browser contents.
  ///
  void(CEF_CALLBACK* print)(struct _cef_browser_host_t* self);

  ///
  /// Print the current browser contents to the PDF file specified by |path| and
  /// execute |callback| on completion. The caller is responsible for deleting
  /// |path| when done. For PDF printing to work on Linux you must implement the
  /// cef_print_handler_t::GetPdfPaperSize function.
  ///
  void(CEF_CALLBACK* print_to_pdf)(
      struct _cef_browser_host_t* self,
      const cef_string_t* path,
      const struct _cef_pdf_print_settings_t* settings,
      struct _cef_pdf_print_callback_t* callback);

  ///
  /// Search for |searchText|. |forward| indicates whether to search forward or
  /// backward within the page. |matchCase| indicates whether the search should
  /// be case-sensitive. |findNext| indicates whether this is the first request
  /// or a follow-up. The search will be restarted if |searchText| or
  /// |matchCase| change. The search will be stopped if |searchText| is NULL.
  /// The cef_find_handler_t instance, if any, returned via
  /// cef_client_t::GetFindHandler will be called to report find results.
  ///
  void(CEF_CALLBACK* find)(struct _cef_browser_host_t* self,
                           const cef_string_t* searchText,
                           int forward,
                           int matchCase,
                           int findNext,
                           int newSession);

  ///
  /// Cancel all searches that are currently going on.
  ///
  void(CEF_CALLBACK* stop_finding)(struct _cef_browser_host_t* self,
                                   int clearSelection);

  ///
  /// Open developer tools (DevTools) in its own browser. The DevTools browser
  /// will remain associated with this browser. If the DevTools browser is
  /// already open then it will be focused, in which case the |windowInfo|,
  /// |client| and |settings| parameters will be ignored. If
  /// |inspect_element_at| is non-NULL then the element at the specified (x,y)
  /// location will be inspected. The |windowInfo| parameter will be ignored if
  /// this browser is wrapped in a cef_browser_view_t.
  ///
  void(CEF_CALLBACK* show_dev_tools)(
      struct _cef_browser_host_t* self,
      const struct _cef_window_info_t* windowInfo,
      struct _cef_client_t* client,
      const struct _cef_browser_settings_t* settings,
      const cef_point_t* inspect_element_at);

  ///
  /// Explicitly close the associated DevTools browser, if any.
  ///
  void(CEF_CALLBACK* close_dev_tools)(struct _cef_browser_host_t* self);

  ///
  /// Returns true (1) if this browser currently has an associated DevTools
  /// browser. Must be called on the browser process UI thread.
  ///
  int(CEF_CALLBACK* has_dev_tools)(struct _cef_browser_host_t* self);

  ///
  /// Send a function call message over the DevTools protocol. |message| must be
  /// a UTF8-encoded JSON dictionary that contains "id" (int), "function"
  /// (string) and "params" (dictionary, optional) values. See the DevTools
  /// protocol documentation at https://chromedevtools.github.io/devtools-
  /// protocol/ for details of supported functions and the expected "params"
  /// dictionary contents. |message| will be copied if necessary. This function
  /// will return true (1) if called on the UI thread and the message was
  /// successfully submitted for validation, otherwise false (0). Validation
  /// will be applied asynchronously and any messages that fail due to
  /// formatting errors or missing parameters may be discarded without
  /// notification. Prefer ExecuteDevToolsMethod if a more structured approach
  /// to message formatting is desired.
  ///
  /// Every valid function call will result in an asynchronous function result
  /// or error message that references the sent message "id". Event messages are
  /// received while notifications are enabled (for example, between function
  /// calls for "Page.enable" and "Page.disable"). All received messages will be
  /// delivered to the observer(s) registered with AddDevToolsMessageObserver.
  /// See cef_dev_tools_message_observer_t::OnDevToolsMessage documentation for
  /// details of received message contents.
  ///
  /// Usage of the SendDevToolsMessage, ExecuteDevToolsMethod and
  /// AddDevToolsMessageObserver functions does not require an active DevTools
  /// front-end or remote-debugging session. Other active DevTools sessions will
  /// continue to function independently. However, any modification of global
  /// browser state by one session may not be reflected in the UI of other
  /// sessions.
  ///
  /// Communication with the DevTools front-end (when displayed) can be logged
  /// for development purposes by passing the `--devtools-protocol-log-
  /// file=<path>` command-line flag.
  ///
  int(CEF_CALLBACK* send_dev_tools_message)(struct _cef_browser_host_t* self,
                                            const void* message,
                                            size_t message_size);

  ///
  /// Execute a function call over the DevTools protocol. This is a more
  /// structured version of SendDevToolsMessage. |message_id| is an incremental
  /// number that uniquely identifies the message (pass 0 to have the next
  /// number assigned automatically based on previous values). |function| is the
  /// function name. |params| are the function parameters, which may be NULL.
  /// See the DevTools protocol documentation (linked above) for details of
  /// supported functions and the expected |params| dictionary contents. This
  /// function will return the assigned message ID if called on the UI thread
  /// and the message was successfully submitted for validation, otherwise 0.
  /// See the SendDevToolsMessage documentation for additional usage
  /// information.
  ///
  int(CEF_CALLBACK* execute_dev_tools_method)(
      struct _cef_browser_host_t* self,
      int message_id,
      const cef_string_t* method,
      struct _cef_dictionary_value_t* params);

  ///
  /// Add an observer for DevTools protocol messages (function results and
  /// events). The observer will remain registered until the returned
  /// Registration object is destroyed. See the SendDevToolsMessage
  /// documentation for additional usage information.
  ///
  struct _cef_registration_t*(CEF_CALLBACK* add_dev_tools_message_observer)(
      struct _cef_browser_host_t* self,
      struct _cef_dev_tools_message_observer_t* observer);

  ///
  /// Retrieve a snapshot of current navigation entries as values sent to the
  /// specified visitor. If |current_only| is true (1) only the current
  /// navigation entry will be sent, otherwise all navigation entries will be
  /// sent.
  ///
  void(CEF_CALLBACK* get_navigation_entries)(
      struct _cef_browser_host_t* self,
      struct _cef_navigation_entry_visitor_t* visitor,
      int current_only);

  ///
  /// If a misspelled word is currently selected in an editable node calling
  /// this function will replace it with the specified |word|.
  ///
  void(CEF_CALLBACK* replace_misspelling)(struct _cef_browser_host_t* self,
                                          const cef_string_t* word);

  ///
  /// Add the specified |word| to the spelling dictionary.
  ///
  void(CEF_CALLBACK* add_word_to_dictionary)(struct _cef_browser_host_t* self,
                                             const cef_string_t* word);

  ///
  /// Returns true (1) if window rendering is disabled.
  ///
  int(CEF_CALLBACK* is_window_rendering_disabled)(
      struct _cef_browser_host_t* self);

  ///
  /// Notify the browser that the widget has been resized. The browser will
  /// first call cef_render_handler_t::GetViewRect to get the new size and then
  /// call cef_render_handler_t::OnPaint asynchronously with the updated
  /// regions. This function is only used when window rendering is disabled.
  ///
  void(CEF_CALLBACK* was_resized)(struct _cef_browser_host_t* self);

  ///
  /// Notify the browser that it has been hidden or shown. Layouting and
  /// cef_render_handler_t::OnPaint notification will stop when the browser is
  /// hidden. This function is only used when window rendering is disabled.
  ///
  void(CEF_CALLBACK* was_hidden)(struct _cef_browser_host_t* self, int hidden);

  ///
  /// Notify the browser that it has been occluded or unoccluded. Layouting and
  /// cef_render_handler_t::OnPaint notification will stop when the browser is
  /// occluded. This function is only used when window rendering is disabled.
  ///
  void(CEF_CALLBACK* was_occluded)(struct _cef_browser_host_t* self,
                                   int occluded);

  ///
  /// Running and do something when the window show
  ///
  void(CEF_CALLBACK* on_window_show)(struct _cef_browser_host_t* self);

  ///
  /// Running and do something when the window hide
  ///
  void(CEF_CALLBACK* on_window_hide)(struct _cef_browser_host_t* self);

  ///
  /// Running and do something when the render visible
  ///
  void(CEF_CALLBACK* on_online_render_to_foreground)(
      struct _cef_browser_host_t* self);

  ///
  /// Send touch event list to the browser for a windowless browser.
  ///
  void(CEF_CALLBACK* send_touch_event_list)(
      struct _cef_browser_host_t* self,
      size_t event_listCount,
      cef_touch_event_t const* event_list);

  ///
  /// Send a notification to the browser that the screen info has changed. The
  /// browser will then call cef_render_handler_t::GetScreenInfo to update the
  /// screen information with the new values. This simulates moving the webview
  /// window from one display to another, or changing the properties of the
  /// current display. This function is only used when window rendering is
  /// disabled.
  ///
  void(CEF_CALLBACK* notify_screen_info_changed)(
      struct _cef_browser_host_t* self);

  ///
  /// Invalidate the view. The browser will call cef_render_handler_t::OnPaint
  /// asynchronously. This function is only used when window rendering is
  /// disabled.
  ///
  void(CEF_CALLBACK* invalidate)(struct _cef_browser_host_t* self,
                                 cef_paint_element_type_t type);

  ///
  /// Issue a BeginFrame request to Chromium.  Only valid when
  /// cef_window_tInfo::external_begin_frame_enabled is set to true (1).
  ///
  void(CEF_CALLBACK* send_external_begin_frame)(
      struct _cef_browser_host_t* self);

  ///
  /// Send a key event to the browser.
  ///
  void(CEF_CALLBACK* send_key_event)(struct _cef_browser_host_t* self,
                                     const cef_key_event_t* event);

  ///
  /// Send a mouse click event to the browser. The |x| and |y| coordinates are
  /// relative to the upper-left corner of the view.
  ///
  void(CEF_CALLBACK* send_mouse_click_event)(struct _cef_browser_host_t* self,
                                             const cef_mouse_event_t* event,
                                             cef_mouse_button_type_t type,
                                             int mouseUp,
                                             int clickCount);

  ///
  /// Send a mouse move event to the browser. The |x| and |y| coordinates are
  /// relative to the upper-left corner of the view.
  ///
  void(CEF_CALLBACK* send_mouse_move_event)(struct _cef_browser_host_t* self,
                                            const cef_mouse_event_t* event,
                                            int mouseLeave);

  ///
  /// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
  /// relative to the upper-left corner of the view. The |deltaX| and |deltaY|
  /// values represent the movement delta in the X and Y directions
  /// respectively. In order to scroll inside select popups with window
  /// rendering disabled cef_render_handler_t::GetScreenPoint should be
  /// implemented properly.
  ///
  void(CEF_CALLBACK* send_mouse_wheel_event)(struct _cef_browser_host_t* self,
                                             const cef_mouse_event_t* event,
                                             int deltaX,
                                             int deltaY);

  ///
  /// Send a touch event to the browser for a windowless browser.
  ///
  void(CEF_CALLBACK* send_touch_event)(struct _cef_browser_host_t* self,
                                       const cef_touch_event_t* event);

  ///
  /// Send a capture lost event to the browser.
  ///
  void(CEF_CALLBACK* send_capture_lost_event)(struct _cef_browser_host_t* self);

  ///
  /// Notify the browser that the window hosting it is about to be moved or
  /// resized. This function is only used on Windows and Linux.
  ///
  void(CEF_CALLBACK* notify_move_or_resize_started)(
      struct _cef_browser_host_t* self);

  ///
  /// Returns the maximum rate in frames per second (fps) that
  /// cef_render_handler_t::OnPaint will be called for a windowless browser. The
  /// actual fps may be lower if the browser cannot generate frames at the
  /// requested rate. The minimum value is 1 and the maximum value is 60
  /// (default 30). This function can only be called on the UI thread.
  ///
  int(CEF_CALLBACK* get_windowless_frame_rate)(
      struct _cef_browser_host_t* self);

  ///
  /// Set the maximum rate in frames per second (fps) that
  /// cef_render_handler_t:: OnPaint will be called for a windowless browser.
  /// The actual fps may be lower if the browser cannot generate frames at the
  /// requested rate. The minimum value is 1 and the maximum value is 60
  /// (default 30). Can also be set at browser creation via
  /// cef_browser_tSettings.windowless_frame_rate.
  ///
  void(CEF_CALLBACK* set_windowless_frame_rate)(
      struct _cef_browser_host_t* self,
      int frame_rate);

  ///
  /// Begins a new composition or updates the existing composition. Blink has a
  /// special node (a composition node) that allows the input function to change
  /// text without affecting other DOM nodes. |text| is the optional text that
  /// will be inserted into the composition node. |underlines| is an optional
  /// set of ranges that will be underlined in the resulting text.
  /// |replacement_range| is an optional range of the existing text that will be
  /// replaced. |selection_range| is an optional range of the resulting text
  /// that will be selected after insertion or replacement. The
  /// |replacement_range| value is only used on OS X.
  ///
  /// This function may be called multiple times as the composition changes.
  /// When the client is done making changes the composition should either be
  /// canceled or completed. To cancel the composition call
  /// ImeCancelComposition. To complete the composition call either
  /// ImeCommitText or ImeFinishComposingText. Completion is usually signaled
  /// when:
  ///
  /// 1. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR
  ///    flag (on Windows), or;
  /// 2. The client receives a "commit" signal of GtkIMContext (on Linux), or;
  /// 3. insertText of NSTextInput is called (on Mac).
  ///
  /// This function is only used when window rendering is disabled.
  ///
  void(CEF_CALLBACK* ime_set_composition)(
      struct _cef_browser_host_t* self,
      const cef_string_t* text,
      size_t underlinesCount,
      cef_composition_underline_t const* underlines,
      const cef_range_t* replacement_range,
      const cef_range_t* selection_range);

  ///
  /// Completes the existing composition by optionally inserting the specified
  /// |text| into the composition node. |replacement_range| is an optional range
  /// of the existing text that will be replaced. |relative_cursor_pos| is where
  /// the cursor will be positioned relative to the current cursor position. See
  /// comments on ImeSetComposition for usage. The |replacement_range| and
  /// |relative_cursor_pos| values are only used on OS X. This function is only
  /// used when window rendering is disabled.
  ///
  void(CEF_CALLBACK* ime_commit_text)(struct _cef_browser_host_t* self,
                                      const cef_string_t* text,
                                      const cef_range_t* replacement_range,
                                      int relative_cursor_pos);

  ///
  /// Completes the existing composition by applying the current composition
  /// node contents. If |keep_selection| is false (0) the current selection, if
  /// any, will be discarded. See comments on ImeSetComposition for usage. This
  /// function is only used when window rendering is disabled.
  ///
  void(CEF_CALLBACK* ime_finish_composing_text)(
      struct _cef_browser_host_t* self,
      int keep_selection);

  ///
  /// Cancels the existing composition and discards the composition node
  /// contents without applying them. See comments on ImeSetComposition for
  /// usage. This function is only used when window rendering is disabled.
  ///
  void(CEF_CALLBACK* ime_cancel_composition)(struct _cef_browser_host_t* self);

  ///
  /// Call this function when the user drags the mouse into the web view (before
  /// calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data|
  /// should not contain file contents as this type of data is not allowed to be
  /// dragged into the web view. File contents can be removed using
  /// cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from
  /// cef_render_handler_t::StartDragging). This function is only used when
  /// window rendering is disabled.
  ///
  void(CEF_CALLBACK* drag_target_drag_enter)(
      struct _cef_browser_host_t* self,
      struct _cef_drag_data_t* drag_data,
      const cef_mouse_event_t* event,
      cef_drag_operations_mask_t allowed_ops);

  ///
  /// Call this function each time the mouse is moved across the web view during
  /// a drag operation (after calling DragTargetDragEnter and before calling
  /// DragTargetDragLeave/DragTargetDrop). This function is only used when
  /// window rendering is disabled.
  ///
  void(CEF_CALLBACK* drag_target_drag_over)(
      struct _cef_browser_host_t* self,
      const cef_mouse_event_t* event,
      cef_drag_operations_mask_t allowed_ops);

  ///
  /// Call this function when the user drags the mouse out of the web view
  /// (after calling DragTargetDragEnter). This function is only used when
  /// window rendering is disabled.
  ///
  void(CEF_CALLBACK* drag_target_drag_leave)(struct _cef_browser_host_t* self);

  ///
  /// Call this function when the user completes the drag operation by dropping
  /// the object onto the web view (after calling DragTargetDragEnter). The
  /// object being dropped is |drag_data|, given as an argument to the previous
  /// DragTargetDragEnter call. This function is only used when window rendering
  /// is disabled.
  ///
  void(CEF_CALLBACK* drag_target_drop)(struct _cef_browser_host_t* self,
                                       const cef_mouse_event_t* event);

  ///
  /// Call this function when the drag operation started by a
  /// cef_render_handler_t::StartDragging call has ended either in a drop or by
  /// being cancelled. |x| and |y| are mouse coordinates relative to the upper-
  /// left corner of the view. If the web view is both the drag source and the
  /// drag target then all DragTarget* functions should be called before
  /// DragSource* mthods. This function is only used when window rendering is
  /// disabled.
  ///
  void(CEF_CALLBACK* drag_source_ended_at)(struct _cef_browser_host_t* self,
                                           int x,
                                           int y,
                                           cef_drag_operations_mask_t op);

  ///
  /// Call this function when the drag operation started by a
  /// cef_render_handler_t::StartDragging call has completed. This function may
  /// be called immediately without first calling DragSourceEndedAt to cancel a
  /// drag operation. If the web view is both the drag source and the drag
  /// target then all DragTarget* functions should be called before DragSource*
  /// mthods. This function is only used when window rendering is disabled.
  ///
  void(CEF_CALLBACK* drag_source_system_drag_ended)(
      struct _cef_browser_host_t* self);

  ///
  /// Returns the current visible navigation entry for this browser. This
  /// function can only be called on the UI thread.
  ///
  struct _cef_navigation_entry_t*(CEF_CALLBACK* get_visible_navigation_entry)(
      struct _cef_browser_host_t* self);

  ///
  /// Set accessibility state for all frames. |accessibility_state| may be
  /// default, enabled or disabled. If |accessibility_state| is STATE_DEFAULT
  /// then accessibility will be disabled by default and the state may be
  /// further controlled with the "force-renderer-accessibility" and "disable-
  /// renderer-accessibility" command-line switches. If |accessibility_state| is
  /// STATE_ENABLED then accessibility will be enabled. If |accessibility_state|
  /// is STATE_DISABLED then accessibility will be completely disabled.
  ///
  /// For windowed browsers accessibility will be enabled in Complete mode
  /// (which corresponds to kAccessibilityModeComplete in Chromium). In this
  /// mode all platform accessibility objects will be created and managed by
  /// Chromium's internal implementation. The client needs only to detect the
  /// screen reader and call this function appropriately. For example, on macOS
  /// the client can handle the @"AXEnhancedUserStructure" accessibility
  /// attribute to detect VoiceOver state changes and on Windows the client can
  /// handle WM_GETOBJECT with OBJID_CLIENT to detect accessibility readers.
  ///
  /// For windowless browsers accessibility will be enabled in TreeOnly mode
  /// (which corresponds to kAccessibilityModeWebContentsOnly in Chromium). In
  /// this mode renderer accessibility is enabled, the full tree is computed,
  /// and events are passed to CefAccessibiltyHandler, but platform
  /// accessibility objects are not created. The client may implement platform
  /// accessibility objects using CefAccessibiltyHandler callbacks if desired.
  ///
  void(CEF_CALLBACK* set_accessibility_state)(struct _cef_browser_host_t* self,
                                              cef_state_t accessibility_state);

  ///
  /// Enable notifications of auto resize via
  /// cef_display_handler_t::OnAutoResize. Notifications are disabled by
  /// default. |min_size| and |max_size| define the range of allowed sizes.
  ///
  void(CEF_CALLBACK* set_auto_resize_enabled)(struct _cef_browser_host_t* self,
                                              int enabled,
                                              const cef_size_t* min_size,
                                              const cef_size_t* max_size);

  ///
  /// Returns the extension hosted in this browser or NULL if no extension is
  /// hosted. See cef_request_context_t::LoadExtension for details.
  ///
  struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
      struct _cef_browser_host_t* self);

  ///
  /// Returns true (1) if this browser is hosting an extension background
  /// script. Background hosts do not have a window and are not displayable. See
  /// cef_request_context_t::LoadExtension for details.
  ///
  int(CEF_CALLBACK* is_background_host)(struct _cef_browser_host_t* self);

  ///
  /// Set whether the browser's audio is muted.
  ///
  void(CEF_CALLBACK* set_audio_muted)(struct _cef_browser_host_t* self,
                                      int mute);

  ///
  /// Returns true (1) if the browser's audio is muted.  This function can only
  /// be called on the UI thread.
  ///
  int(CEF_CALLBACK* is_audio_muted)(struct _cef_browser_host_t* self);

  ///
  /// GetRootBrowserAccessibilityManager
  ///
  void(CEF_CALLBACK* get_root_browser_accessibility_manager)(
      struct _cef_browser_host_t* self,
      void** manager);

  ///
  /// Execute a string of JavaScript code, return result by callback
  ///
  void(CEF_CALLBACK* execute_java_script)(
      struct _cef_browser_host_t* self,
      const char* code,
      struct _cef_java_script_result_callback_t* callback,
      int extention);

  ///
  /// Execute a string of JavaScript code, return result by callback
  ///
  void(CEF_CALLBACK* execute_java_script_ext)(
      struct _cef_browser_host_t* self,
      const int fd,
      const uint64 scriptLength,
      struct _cef_java_script_result_callback_t* callback,
      int extention);

  ///
  /// Set native window from ohos rs
  ///
  void(CEF_CALLBACK* set_native_window)(struct _cef_browser_host_t* self,
                                        cef_native_window_t window);

  ///
  /// Set web debugging access
  ///
  void(CEF_CALLBACK* set_web_debugging_access)(struct _cef_browser_host_t* self,
                                               int isEnableDebug);

  ///
  /// Get web debugging access
  ///
  int(CEF_CALLBACK* get_web_debugging_access)(struct _cef_browser_host_t* self);

  ///
  /// GetImageForContextNode
  ///
  void(CEF_CALLBACK* get_image_for_context_node)(
      struct _cef_browser_host_t* self);

  ///
  /// GetImageFromCache
  ///
  void(CEF_CALLBACK* get_image_from_cache)(struct _cef_browser_host_t* self,
                                           const cef_string_t* url);

  ///
  /// ExitFullScreen
  ///
  void(CEF_CALLBACK* exit_full_screen)(struct _cef_browser_host_t* self);

  ///
  /// UpdateLocale
  ///
  void(CEF_CALLBACK* update_locale)(struct _cef_browser_host_t* self,
                                    const cef_string_t* locale);

  ///
  /// Returns the original url of the request.
  ///
  // The resulting string must be freed by calling cef_string_userfree_free().
  cef_string_userfree_t(CEF_CALLBACK* get_original_url)(
      struct _cef_browser_host_t* self);

  ///
  /// Set network status
  ///
  void(CEF_CALLBACK* put_network_available)(struct _cef_browser_host_t* self,
                                            int available);

  ///
  /// Remove web cache
  ///
  void(CEF_CALLBACK* remove_cache)(struct _cef_browser_host_t* self,
                                   int include_disk_files);

  ///
  /// Post task to ui thread.
  ///
  void(CEF_CALLBACK* post_task_to_uithread)(struct _cef_browser_host_t* self,
                                            struct _cef_task_t* task);

  ///
  /// Set the virtual pixel ratio
  ///
  void(CEF_CALLBACK* set_virtual_pixel_ratio)(struct _cef_browser_host_t* self,
                                              float ratio);

  ///
  /// Get the virtual pixel ratio
  ///
  float(CEF_CALLBACK* get_virtual_pixel_ratio)(
      struct _cef_browser_host_t* self);

  ///
  /// Recompute the WebPreferences based on the current state of the
  /// CefSettings, we will also call SetWebPreferences and send the updated
  /// WebPreferences to all RenderViews by WebContents.
  ///
  void(CEF_CALLBACK* set_web_preferences)(
      struct _cef_browser_host_t* self,
      const struct _cef_browser_settings_t* browser_settings);

  ///
  /// PutUserAgent
  ///
  void(CEF_CALLBACK* put_user_agent)(struct _cef_browser_host_t* self,
                                     const cef_string_t* ua);

  ///
  /// DefaultUserAgent
  ///
  // The resulting string must be freed by calling cef_string_userfree_free().
  cef_string_userfree_t(CEF_CALLBACK* default_user_agent)(
      struct _cef_browser_host_t* self);

  ///
  /// SetBackgroundColor
  ///
  void(CEF_CALLBACK* set_background_color)(struct _cef_browser_host_t* self,
                                           int color);

  ///
  /// UpdateEasyListRules
  ///
  void(CEF_CALLBACK* update_adblock_easy_list_rules)(
      struct _cef_browser_host_t* self,
      long adBlockEasyListVersion);

  ///
  /// RegisterArkJSfunction
  ///
  void(CEF_CALLBACK* register_ark_jsfunction)(
      struct _cef_browser_host_t* self,
      const cef_string_t* object_name,
      cef_string_list_t method_list,
      cef_string_list_t async_method_list,
      int32_t object_id,
      const cef_string_t* permission);

  ///
  /// UnregisterArkJSfunction
  ///
  void(CEF_CALLBACK* unregister_ark_jsfunction)(
      struct _cef_browser_host_t* self,
      const cef_string_t* object_name,
      cef_string_list_t method_list);

  ///
  /// CallH5Function
  ///
  void(CEF_CALLBACK* call_h5function)(struct _cef_browser_host_t* self,
                                      int32_t routing_id,
                                      int32_t h5_object_id,
                                      const cef_string_t* h5_method_name,
                                      size_t argsCount,
                                      struct _cef_value_t* const* args);

  ///
  /// Saves the current view as a web archive.
  ///
  void(CEF_CALLBACK* store_web_archive)(
      struct _cef_browser_host_t* self,
      const cef_string_t* base_name,
      int auto_name,
      struct _cef_store_web_archive_result_callback_t* callback);

  ///
  /// Notify the browser that the widget has been resized because of virtual
  /// keyboard.
  ///
  void(CEF_CALLBACK* was_keyboard_resized)(struct _cef_browser_host_t* self);

  ///
  /// Set if lower the frame rate.
  ///
  void(CEF_CALLBACK* set_enable_lower_frame_rate)(
      struct _cef_browser_host_t* self,
      int enabled);

  ///
  /// Gets the title for the current page.
  ///
  // The resulting string must be freed by calling cef_string_userfree_free().
  cef_string_userfree_t(CEF_CALLBACK* title)(struct _cef_browser_host_t* self);

  ///
  /// Create a message channel, which include two message ports.
  ///
  void(CEF_CALLBACK* create_web_message_ports)(struct _cef_browser_host_t* self,
                                               cef_string_list_t ports);

  ///
  /// Posts a MessageEvent to the main frame.
  ///
  void(CEF_CALLBACK* post_web_message)(struct _cef_browser_host_t* self,
                                       cef_string_t* message,
                                       cef_string_list_t ports,
                                       cef_string_t* targetUri);

  ///
  /// Close the web message port.
  ///
  void(CEF_CALLBACK* close_port)(struct _cef_browser_host_t* self,
                                 cef_string_t* port_handle);

  ///
  /// Destroy all web message ports.
  ///
  void(CEF_CALLBACK* destroy_all_web_message_ports)(
      struct _cef_browser_host_t* self);

  ///
  /// Post a message to the port.
  ///
  void(CEF_CALLBACK* post_port_message)(struct _cef_browser_host_t* self,
                                        const cef_string_t* port_handle,
                                        struct _cef_value_t* message);

  ///
  /// Set the callback of the port.
  ///
  void(CEF_CALLBACK* set_port_message_callback)(
      struct _cef_browser_host_t* self,
      const cef_string_t* port_handle,
      struct _cef_web_message_receiver_t* callback);

  ///
  /// Gets the latest hitdata
  ///
  void(CEF_CALLBACK* get_hit_data)(struct _cef_browser_host_t* self,
                                   int* type,
                                   cef_string_t* extra_data);

  ///
  /// Set the inital page scale
  ///
  void(CEF_CALLBACK* set_initial_scale)(struct _cef_browser_host_t* self,
                                        float scale);

  ///
  /// Gets the progress for the current page.
  ///
  int(CEF_CALLBACK* page_load_progress)(struct _cef_browser_host_t* self);

  ///
  /// Gets the progress for the current page.
  ///
  float(CEF_CALLBACK* scale)(struct _cef_browser_host_t* self);

  ///
  /// Loads the given data into this WebView, using baseUrl as the base URL for
  /// the content. The base URL is used both to resolve relative URLs and when
  /// applying JavaScript's same origin policy. The historyUrl is used for the
  /// history entry. optional_param=baseUrl, optional_param=data,
  /// optional_param=mimeType, optional_param=encoding,
  /// optional_param=historyUrl
  ///
  void(CEF_CALLBACK* load_with_data_and_base_url)(
      struct _cef_browser_host_t* self,
      const cef_string_t* baseUrl,
      const cef_string_t* data,
      const cef_string_t* mimeType,
      const cef_string_t* encoding,
      const cef_string_t* historyUrl);

  ///
  /// Loads the given data into this WebView optional_param=data,
  /// optional_param=mimeType, optional_param=encoding,
  ///
  void(CEF_CALLBACK* load_with_data)(struct _cef_browser_host_t* self,
                                     const cef_string_t* data,
                                     const cef_string_t* mimeType,
                                     const cef_string_t* encoding);

  ///
  /// add visited url.
  ///
  void(CEF_CALLBACK* add_visited_links)(struct _cef_browser_host_t* self,
                                        cef_string_list_t urls);

  ///
  /// Resume download after interrupted.
  ///
  void(CEF_CALLBACK* resume_download)(
      struct _cef_browser_host_t* self,
      const cef_string_t* url,
      const cef_string_t* full_path,
      int64 received_bytes,
      int64 total_bytes,
      const cef_string_t* etag,
      const cef_string_t* mime_type,
      const cef_string_t* last_modified,
      const cef_string_t* received_slices_string);

  ///
  ///  Set the audio resume interval of the broswer.
  ///
  void(CEF_CALLBACK* set_audio_resume_interval)(
      struct _cef_browser_host_t* self,
      int resumeInterval);

  ///
  ///  Set whether the browser's audio is exclusive.
  ///
  void(CEF_CALLBACK* set_audio_exclusive)(struct _cef_browser_host_t* self,
                                          int audioExclusive);

  ///
  /// Close fullScreen video.
  ///
  void(CEF_CALLBACK* close_media)(struct _cef_browser_host_t* self);

  ///
  /// Stop all audio and video playback on the web page.
  ///
  void(CEF_CALLBACK* stop_media)(struct _cef_browser_host_t* self);

  ///
  /// Restart playback of all audio and video on the web page.
  ///
  void(CEF_CALLBACK* resume_media)(struct _cef_browser_host_t* self);

  ///
  /// Pause all audio and video playback on the web page.
  ///
  void(CEF_CALLBACK* pause_media)(struct _cef_browser_host_t* self);

  ///
  /// View the playback status of all audio and video on the web page.
  ///
  int(CEF_CALLBACK* get_media_playback_state)(struct _cef_browser_host_t* self);

  ///
  /// Scroll page up or down
  ///
  void(CEF_CALLBACK* scroll_page_up_down)(struct _cef_browser_host_t* self,
                                          int is_up,
                                          int is_half,
                                          float view_height);

  ///
  /// Get web history state
  ///
  struct _cef_binary_value_t*(CEF_CALLBACK* get_web_state)(
      struct _cef_browser_host_t* self);

  ///
  /// Restore web history state
  ///
  int(CEF_CALLBACK* restore_web_state)(struct _cef_browser_host_t* self,
                                       struct _cef_binary_value_t* state);

  ///
  /// Scroll to the position.
  ///
  void(CEF_CALLBACK* scroll_to)(struct _cef_browser_host_t* self,
                                float x,
                                float y);

  ///
  /// Scroll by the delta distance.
  ///
  void(CEF_CALLBACK* scroll_by)(struct _cef_browser_host_t* self,
                                float delta_x,
                                float delta_y);

  ///
  /// Slide Scroll by the speed.
  ///
  void(CEF_CALLBACK* slide_scroll)(struct _cef_browser_host_t* self,
                                   float vx,
                                   float vy);

  ///
  /// Set whether webview can access files
  ///
  void(CEF_CALLBACK* set_file_access)(struct _cef_browser_host_t* self,
                                      int falg);

  ///
  /// Set whether webview can access network
  ///
  void(CEF_CALLBACK* set_block_network)(struct _cef_browser_host_t* self,
                                        int falg);

  ///
  /// Set the cache mode of webview
  ///
  void(CEF_CALLBACK* set_cache_mode)(struct _cef_browser_host_t* self,
                                     int falg);

  ///
  /// Set should frame submission before draw
  ///
  void(CEF_CALLBACK* set_should_frame_submission_before_draw)(
      struct _cef_browser_host_t* self,
      int should);

  ///
  /// Set zoom with the dela facetor
  ///
  void(CEF_CALLBACK* zoom_by)(struct _cef_browser_host_t* self,
                              float delta,
                              float width,
                              float height);

  ///
  /// Set the window id of the UI framework
  ///
  void(CEF_CALLBACK* set_window_id)(struct _cef_browser_host_t* self,
                                    int window_id,
                                    int nweb_id);

  ///
  /// Set the token of the UI framework
  ///
  void(CEF_CALLBACK* set_token)(struct _cef_browser_host_t* self, void* token);

  ///
  /// Set the property values for width, height, and keyboard height
  ///
  void(CEF_CALLBACK* set_virtual_key_board_arg)(
      struct _cef_browser_host_t* self,
      int32_t width,
      int32_t height,
      double keyboard);

  ///
  /// Set the virtual keyboard to override the web status
  ///
  int(CEF_CALLBACK* should_virtual_keyboard_overlay)(
      struct _cef_browser_host_t* self);

  ///
  /// JavaScriptOnDocumentStart
  ///
  void(CEF_CALLBACK* java_script_on_document_start)(
      struct _cef_browser_host_t* self,
      const cef_string_t* script,
      cef_string_list_t script_rules);

  ///
  /// RemoveJavaScriptOnDocumentStart
  ///
  void(CEF_CALLBACK* remove_java_script_on_document_start)(
      struct _cef_browser_host_t* self);

  ///
  /// JavaScriptOnDocumentEnd
  ///
  void(CEF_CALLBACK* java_script_on_document_end)(
      struct _cef_browser_host_t* self,
      const cef_string_t* script,
      cef_string_list_t script_rules);

  ///
  /// RemoveJavaScriptOnDocumentEnd
  ///
  void(CEF_CALLBACK* remove_java_script_on_document_end)(
      struct _cef_browser_host_t* self);

  ///
  /// Set the draw rect
  ///
  void(CEF_CALLBACK* set_draw_rect)(struct _cef_browser_host_t* self,
                                    int x,
                                    int y,
                                    int width,
                                    int height);

  ///
  /// Set the draw mode
  ///
  void(CEF_CALLBACK* set_draw_mode)(struct _cef_browser_host_t* self, int mode);

  ///
  /// Create the Web print document adapter of the UI framework
  ///
  void(CEF_CALLBACK* create_web_print_document_adapter)(
      struct _cef_browser_host_t* self,
      const cef_string_t* jobName,
      void** webPrintDocumentAdapter);

  ///
  /// Set the over-scroll mode of web
  ///
  void(CEF_CALLBACK* set_overscroll_mode)(struct _cef_browser_host_t* self,
                                          int mode);

  ///
  /// Discard a webview window
  ///
  int(CEF_CALLBACK* discard)(struct _cef_browser_host_t* self);

  ///
  /// Restore the discarded webview window
  ///
  int(CEF_CALLBACK* restore)(struct _cef_browser_host_t* self);

  ///
  /// Change the zoom factor for browser zoom. If called on the UI thread the
  /// change will be applied immediately. Otherwise, the change will be applied
  /// asynchronously on the UI thread.
  ///
  void(CEF_CALLBACK* set_browser_zoom_level)(struct _cef_browser_host_t* self,
                                             double zoomFactor);

  ///
  /// Get the top controls offset.
  ///
  int(CEF_CALLBACK* get_top_controls_offset)(struct _cef_browser_host_t* self);

  ///
  /// Get the shrink viewport height.
  ///
  int(CEF_CALLBACK* get_shrink_viewport_height)(
      struct _cef_browser_host_t* self);

  ///
  /// Set background print enable.
  ///
  void(CEF_CALLBACK* set_print_background)(struct _cef_browser_host_t* self,
                                           int enable);

  ///
  /// Get whether print background.
  ///
  int(CEF_CALLBACK* get_print_background)(struct _cef_browser_host_t* self);

  ///
  /// set Scrollable
  ///
  void(CEF_CALLBACK* set_scrollable)(struct _cef_browser_host_t* self,
                                     int enable,
                                     int scrollType);

  ///
  ///  Start current camera.
  ///
  void(CEF_CALLBACK* start_camera)(struct _cef_browser_host_t* self);

  ///
  ///  Stop current camera.
  ///
  void(CEF_CALLBACK* stop_camera)(struct _cef_browser_host_t* self);

  ///
  ///  Close current camera.
  ///
  void(CEF_CALLBACK* close_camera)(struct _cef_browser_host_t* self);

  ///
  /// Get the last javascript proxy calling frame url.
  ///
  // The resulting string must be freed by calling cef_string_userfree_free().
  cef_string_userfree_t(
      CEF_CALLBACK* get_last_javascript_proxy_calling_frame_url)(
      struct _cef_browser_host_t* self);

  ///
  ///  Set NWebID.
  ///
  void(CEF_CALLBACK* set_nweb_id)(struct _cef_browser_host_t* self, int nWebId);

  ///
  /// get pendingSizeStatus.
  ///
  int(CEF_CALLBACK* get_pending_size_status)(struct _cef_browser_host_t* self);

  ///
  ///  precompile javascript and generate code cache.
  ///
  void(CEF_CALLBACK* precompile_java_script)(
      struct _cef_browser_host_t* self,
      const char* url,
      const char* script,
      struct _cef_cache_options_t* cacheOptions,
      struct _cef_precompile_callback_t* callback);

  ///
  /// SetWakeLockHandler.
  ///
  void(CEF_CALLBACK* set_wake_lock_handler)(
      struct _cef_browser_host_t* self,
      int32_t windowId,
      struct _cef_set_lock_callback_t* callback);

  ///
  /// Get cef_download_item_t by download_item_id.
  ///
  struct _cef_download_item_t*(CEF_CALLBACK* get_download_item)(
      struct _cef_browser_host_t* self,
      uint32 item_id);

  ///
  ///  Notify browser host needs reload when the render process terminated.
  ///
  void(CEF_CALLBACK* notify_needs_reload)(struct _cef_browser_host_t* self,
                                          int needs_reload);

  ///
  ///  Return true if needs reload page, or false if nees not reload.
  ///
  int(CEF_CALLBACK* needs_reload)(struct _cef_browser_host_t* self);

  ///
  /// Terminate render process
  ///
  int(CEF_CALLBACK* terminate_render_process)(struct _cef_browser_host_t* self);

  ///
  /// RegisterNativeJSProxy
  ///
  void(CEF_CALLBACK* register_native_jsproxy)(struct _cef_browser_host_t* self,
                                              const cef_string_t* object_name,
                                              cef_string_list_t method_list,
                                              int32_t object_id,
                                              int is_async,
                                              const cef_string_t* permission);

  ///
  /// SendTouchpadFlingEvent
  ///
  void(CEF_CALLBACK* send_touchpad_fling_event)(
      struct _cef_browser_host_t* self,
      const cef_mouse_event_t* event,
      double vx,
      double vy);

  ///
  /// Set the fit content mode
  ///
  void(CEF_CALLBACK* set_fit_content_mode)(struct _cef_browser_host_t* self,
                                           int mode);

  ///
  /// update draw_rect state.
  ///
  void(CEF_CALLBACK* update_draw_rect)(struct _cef_browser_host_t* self);

  ///
  /// Called when text is selected.
  ///
  void(CEF_CALLBACK* on_text_selected)(struct _cef_browser_host_t* self,
                                       int flag);

  ///
  /// Get page scale factor.
  ///
  float(CEF_CALLBACK* get_page_scale_factor)(struct _cef_browser_host_t* self);

  ///
  /// WebPageSnapshot, return result by callback
  ///
  int(CEF_CALLBACK* web_page_snapshot)(struct _cef_browser_host_t* self,
                                       const char* id,
                                       int width,
                                       int height,
                                       cef_web_snapshot_callback_t callback);

  ///
  /// Advance focus for IME to the browser.
  ///
  void(CEF_CALLBACK* advance_focus_for_ime)(struct _cef_browser_host_t* self,
                                            int focusType);

  ///
  /// Scroll to the position with anime.
  ///
  void(CEF_CALLBACK* scroll_to_with_anime)(struct _cef_browser_host_t* self,
                                           float x,
                                           float y,
                                           int32_t duration);

  ///
  /// Scroll by the delta with anime.
  ///
  void(CEF_CALLBACK* scroll_by_with_anime)(struct _cef_browser_host_t* self,
                                           float delta_x,
                                           float delta_y,
                                           int32_t duration);

  ///
  /// Get the current scroll offset of the webpage.
  ///
  void(CEF_CALLBACK* get_scroll_offset)(struct _cef_browser_host_t* self,
                                        float* offset_x,
                                        float* offset_y);

  ///
  /// Get the current overscroll offset of the webpage.
  ///
  void(CEF_CALLBACK* get_over_scroll_offset)(struct _cef_browser_host_t* self,
                                             float* offset_x,
                                             float* offset_y);

  ///
  /// OnSafeInsetsChange
  ///
  void(CEF_CALLBACK* on_safe_insets_change)(struct _cef_browser_host_t* self,
                                            int left,
                                            int top,
                                            int right,
                                            int bottom);

  ///
  /// SetNativeEmbedMode.
  ///
  void(CEF_CALLBACK* set_native_embed_mode)(struct _cef_browser_host_t* self,
                                            int flag);

  ///
  /// Notify for next touch move event.
  ///
  void(CEF_CALLBACK* notify_for_next_touch_event)(
      struct _cef_browser_host_t* self);

  ///
  /// Set grant file access dirs.
  ///
  void(CEF_CALLBACK* set_grant_file_access_dirs)(
      struct _cef_browser_host_t* self,
      cef_string_list_t dir_list);

  ///
  /// Set the callback of the autofill event.
  ///
  void(CEF_CALLBACK* set_autofill_callback)(
      struct _cef_browser_host_t* self,
      struct _cef_web_message_receiver_t* callback);

  ///
  /// Fill autofill data.
  ///
  void(CEF_CALLBACK* fill_autofill_data)(struct _cef_browser_host_t* self,
                                         struct _cef_value_t* message);

  ///
  /// ScrollFocusedEditableNodeIntoView.
  ///
  void(CEF_CALLBACK* scroll_focused_editable_node_into_view)(
      struct _cef_browser_host_t* self);

  ///
  /// Process autofill cancel content.
  ///
  void(CEF_CALLBACK* process_autofill_cancel)(struct _cef_browser_host_t* self,
                                              const char* fillContent);

  ///
  /// request autofill from IMF event.
  ///
  void(CEF_CALLBACK* auto_fill_with_imfevent)(struct _cef_browser_host_t* self,
                                              int is_username,
                                              int is_other_account,
                                              int is_new_password,
                                              const char* content);

  ///
  /// Create pdf data stream.
  ///
  void(CEF_CALLBACK* create_to_pdf)(
      struct _cef_browser_host_t* self,
      const struct _cef_pdf_print_settings_t* settings,
      struct _cef_pdf_value_callback_t* callback);

  ///
  /// SetPopupWindow.
  ///
  void(CEF_CALLBACK* set_popup_window)(struct _cef_browser_host_t* self,
                                       cef_native_window_t window);
} cef_browser_host_t;

///
/// Create a new browser using the window parameters specified by |windowInfo|.
/// All values will be copied internally and the actual window (if any) will be
/// created on the UI thread. If |request_context| is NULL the global request
/// context will be used. This function can be called on any browser process
/// thread and will not block. The optional |extra_info| parameter provides an
/// opportunity to specify extra information specific to the created browser
/// that will be passed to cef_render_process_handler_t::on_browser_created() in
/// the render process.
///
CEF_EXPORT int cef_browser_host_create_browser(
    const cef_window_info_t* windowInfo,
    struct _cef_client_t* client,
    const cef_string_t* url,
    const struct _cef_browser_settings_t* settings,
    struct _cef_dictionary_value_t* extra_info,
    struct _cef_request_context_t* request_context);

///
/// Create a new browser using the window parameters specified by |windowInfo|.
/// If |request_context| is NULL the global request context will be used. This
/// function can only be called on the browser process UI thread. The optional
/// |extra_info| parameter provides an opportunity to specify extra information
/// specific to the created browser that will be passed to
/// cef_render_process_handler_t::on_browser_created() in the render process.
///
CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync(
    const cef_window_info_t* windowInfo,
    struct _cef_client_t* client,
    const cef_string_t* url,
    const struct _cef_browser_settings_t* settings,
    struct _cef_dictionary_value_t* extra_info,
    struct _cef_request_context_t* request_context);

#ifdef __cplusplus
}
#endif

#endif  // CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
